<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="../../topjui/css/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="../../topjui/themes/default/topjui.blue.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="../../static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- layui框架样式 -->
    <link type="text/css" href="../../static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="../../static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="../../static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="../../static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="../../topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="../../topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- layui框架js -->
    <script type="text/javascript" src="../../static/plugins/layui/layui.js" charset="utf-8"></script>
</head>

<body>
<div id="configEdatagrid"></div>

<!-- 表格工具栏 -->
<div id="configEdatagrid-toolbar" data-options="grid:{
           type:'edatagrid',
           id:'configEdatagrid'
       }" class="topjui-toolbar">
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'edatagrid',
       extend: '#configEdatagrid-toolbar',
       iconCls:'fa fa-plus',
       btnCls:'topjui-btn-green',
       type:'addRow'">新增</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'edatagrid',
       extend: '#configEdatagrid-toolbar',
       iconCls:'fa fa-save',
       btnCls:'topjui-btn-brown',
       type:'saveRow'">保存</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'edatagrid',
       extend: '#configEdatagrid-toolbar',
       iconCls:'fa fa-remove',
       btnCls:'topjui-btn-black',
       type:'cancelRow'">取消</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'doAjax',
       extend: '#configEdatagrid-toolbar',
       iconCls:'fa fa-remove',
       btnCls:'topjui-btn-blue',
       url:_ctx + '/json/response/delete.json'">删除</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'filter',
       extend: '#configEdatagrid-toolbar',
       btnCls:'topjui-btn-black'">过滤</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'search',
       extend: '#configEdatagrid-toolbar',
       btnCls:'topjui-btn-blue'">查询</a>
</div>

<script>
    var grid = {
        type: 'datagrid',
        id: 'configEdatagrid'
    };
    $("#" + grid.id).iEdatagrid({
        selectOnCheck: true,
        url: '../../json/config/config_1.json',
        saveUrl: _ctx + '/json/response/save.json',
        updateUrl: _ctx + '/json/response/update.json',
        columns: [[
            {field: 'uuid', title: 'UUID', checkbox: true},
            {
                field: 'type',
                title: '类型',
                sortable: true,
                editor: {type: 'textbox', options: {required: true, height: 30}}
            },
            {
                field: 'sort',
                title: '排序',
                sortable: true,
                editor: {type: 'numberspinner', options: {required: true, height: 30}}
            },
            {
                field: 'name',
                title: '名称',
                sortable: true,
                editor: {type: 'textbox', options: {required: true, height: 30}}
            },
            {
                field: 'code',
                title: '代码',
                sortable: true,
                editor: {type: 'textbox', options: {required: true, height: 30}}
            },
            {
                field: 'value',
                title: '值',
                sortable: true,
                editor: {type: 'textbox', options: {required: true, height: 30}}
            },
            {
                field: 'description',
                title: '描述',
                sortable: true,
                editor: {type: 'textbox', options: {required: true, height: 30}}
            },
            {field: 'creator', title: '创建人', sortable: true},
            {field: 'createTime', title: '创建时间', sortable: true}
        ]],
        toolbar: [{
            iconCls: 'fa fa-pencil',
            btnCls: 'topjui-btn-green',
            text: '编辑',
            handler: function () {
                $.iMessager.alert('操作提示', '编辑操作！', 'messager-info');
            }
        }, '-', {
            iconCls: 'fa fa-cog',
            btnCls: 'topjui-btn-red',
            text: '删除',
            handler: function () {
                $.iMessager.alert('操作提示', '删除操作！', 'messager-info');
            }
        }]
    });
</script>
</body>
</html>